package com.homework.Tools;

import com.ZmqTools.Zmq_Random.Zmq_Random;

import java.util.Arrays;
import java.util.Scanner;

public class Guess_num {

  public static void guess_num(int a){
    Scanner scanner = new Scanner(System.in);
    while(true){
      System.out.println("输入个数：");
      int num = scanner.nextInt();
      if(num > a){
        System.out.println("大了");
        continue;
      }else if(num < a){
        System.out.println("小了");
        continue;
      }else{
        System.out.println("答对了");
        break;
      }
  }

  }

  public static void main(String[] args) {
    //
    int[] arr = new int[10];
    for (int i = 0; i < arr.length; i++) {
      //
      arr[i] = Zmq_Random.getAnum(1, 2016);
    }
    System.out.println(Arrays.toString(arr));
    Arrays.sort(arr);
    int max = arr[arr.length-1];
    System.out.println(max);
    Guess_num.guess_num(max);
  }
}
